//饼图
var data1st=[
	{name:'教育类',value:43261 }, 
	{name:'新闻类',value:12568 },
	{name:'金融类',value:187929},
	{name:'政府类',value:14913 },
	{name:'卫生类',value:26144 }
]

function dataLegend(data){
	var dataLe=[];
	for(var i=0;i<data.length;i++){
		dataLe.push(data[i].name)
	}
	return dataLe
}

var pieOpt={
	//color : ["#fce24f","#b8ff2e","#09e24b","#09e2cb","#09a7e2", "#0841b6", "#30059c", "#68059c","#9c058c","#9c0550"],
	color:["#09a7e2","#b8ff2e","#09e24b","#09e2cb","#fce24f","#f46a17","#d40d03"],
  tooltip : {
      trigger: 'item',
      formatter: "{a} <br/>{b} : {c} ({d}%)"
  },
  legend: {
	  show:false,
//	      orient: 'vertical',
      left: 'left',
      bottom: 'bottom',
      textStyle :{
      	color: '#fff'
      }
  },
  series : [
    {
      name: '',
      type: 'pie',
      radius : ['35%','55%'],
      center: ['50%', '50%'],
      data:[],
      itemStyle: {
          emphasis: {
              shadowBlur: 10,
              shadowOffsetX: 0,
              shadowColor: 'rgba(0, 0, 0, 0.5)'
          }
      }
    }
  ]
}
pieOpt.series[0].data=data1st;
pieOpt.legend.data=dataLegend(data1st)
var pieChart = echarts.init(document.getElementById('ecPie'));
pieChart.setOption(pieOpt);

function getPieOpt(datas){
	var pieOpt = {
		color:["#09a7e2","#b8ff2e","#09e24b","#09e2cb","#fce24f","#f46a17","#d40d03"],
	  tooltip : {
	      trigger: 'item',
	      formatter: "{a} <br/>{b} : {c} ({d}%)"
	  },
	  legend: {
		  show:false,
//		  orient: 'vertical',
	      left: 'left',
	      bottom: 'bottom',
	      textStyle :{
	      	color: '#fff'
	      }
	  },
	  series : [
	    {
	      name: '',
	      type: 'pie',
	      radius : ['35%','55%'],
	      center: ['50%', '50%'],
	      data:[],
	      itemStyle: {
	          emphasis: {
	              shadowBlur: 10,
	              shadowOffsetX: 0,
	              shadowColor: 'rgba(0, 0, 0, 0.5)'
	          }
	      },
	    }
	  ]
	}
	pieOpt.series[0].data=datas;
	pieOpt.legend.data=dataLegend(datas)
	return pieOpt;
}

function getOptionBar(datas){
	//柱状图
	var pieOpt = {
	//  color : ["#fce24f","#b8ff2e","#09e24b","#09e2cb","#09a7e2", "#0841b6", "#30059c", "#68059c","#9c058c","#9c0550"],
		color:["#09a7e2","#b8ff2e","#09e24b","#09e2cb","#fce24f","#f46a17","#d40d03"],
	  tooltip : {
	      trigger: 'item',
	      formatter: "{a} <br/>{b} : {c} ({d}%)"
	  },
	  legend: {
		  show:false,
//		  orient: 'vertical',
	      left: 'left',
	      bottom: 'bottom',
	      textStyle :{
	      	color: '#fff'
	      }
	  },
	  series : [
	    {
	      name: '',
	      type: 'pie',
	      radius : ['35%','55%'],
	      center: ['50%', '50%'],
	      data:[],
	      itemStyle: {
	          emphasis: {
	              shadowBlur: 10,
	              shadowOffsetX: 0,
	              shadowColor: 'rgba(0, 0, 0, 0.5)'
	          }
	      },
	    }
	  ]
	}
	pieOpt.series[0].data=datas;
	return pieOpt;
}

// 左上饼图
   	
var dataPie1=[
	{name:'广东',value:564155},
	{name:'上海',value:324766},
	{name:'福建',value:265161},
	{name:'浙江',value:136610},
	{name:'重庆',value:78114},
	{name:'云南',value:71919},
	{name:'广西',value:38753},
	{name:'陕西',value:38312},
	{name:'黑龙江',value:24952},
	{name:'辽宁',value:17061}
]
var dataPie2=[
	{name:'四川',value:358594},
	{name:'云南',value:71919},
	{name:'重庆',value:78114},
	{name:'贵州',value:4419},
	{name:'西藏',value:290}
]

var dataPie3=[
	{name:'广东',value:564155},
	{name:'上海',value:324766},
	{name:'福建',value:265161},
	{name:'山东',value:220714},
	{name:'浙江',value:136610},
	{name:'江苏',value:121998},
	//{name:'天津',value:121130},
	//{name:'河北',value:59478},
	//{name:'辽宁',value:17061},
	{name:'海南',value:4929}
]   	
optionBar = {
	color:["#09a7e2","#b8ff2e","#09e24b","#09e2cb","#fce24f","#f46a17","#d40d03"],
  tooltip : {
      trigger: 'item',
      formatter: "{a} <br/>{b} : {c} ({d}%)"
  },
  legend: {
	  show:false,
//	      orient: 'vertical',
      left: 'left',
      bottom: 'bottom',
      textStyle :{
      	color: '#fff'
      }
  },
  series : [
    {
      name: '',
      type: 'pie',
      radius : ['35%','55%'],
      center: ['50%', '50%'],
      data:[],
      itemStyle: {
          emphasis: {
              shadowBlur: 10,
              shadowOffsetX: 0,
              shadowColor: 'rgba(0, 0, 0, 0.5)'
          }
      }
    }
  ]
};
optionBar.series[0].data=dataPie3;
var barChart = echarts.init(document.getElementById('ecBar'))
barChart.setOption(optionBar)

//地图
var geoCoordMap = {
    '海门':[121.15,31.89],
    '鄂尔多斯':[109.781327,39.608266],
    '招远':[120.38,37.35],
    '舟山':[122.207216,29.985295],
    '齐齐哈尔':[123.97,47.33],
    '盐城':[120.13,33.38],
    '赤峰':[118.87,42.28],
    '青岛':[120.33,36.07],
    '乳山':[121.52,36.89],
    '金昌':[102.188043,38.520089],
    '泉州':[118.58,24.93],
    '莱西':[120.53,36.86],
    '日照':[119.46,35.42],
    '胶南':[119.97,35.88],
    '南通':[121.05,32.08],
    '拉萨':[91.11,29.97],
    '云浮':[112.02,22.93],
    '梅州':[116.1,24.55],
    '文登':[122.05,37.2],
    '上海':[121.48,31.22],
    '攀枝花':[101.718637,26.582347],
    '威海':[122.1,37.5],
    '承德':[117.93,40.97],
    '厦门':[118.1,24.46],
    '汕尾':[115.375279,22.786211],
    '潮州':[116.63,23.68],
    '丹东':[124.37,40.13],
    '太仓':[121.1,31.45],
    '曲靖':[103.79,25.51],
    '烟台':[121.39,37.52],
    '福州':[119.3,26.08],
    '瓦房店':[121.979603,39.627114],
    '即墨':[120.45,36.38],
    '抚顺':[123.97,41.97],
    '玉溪':[102.52,24.35],
    '张家口':[114.87,40.82],
    '阳泉':[113.57,37.85],
    '莱州':[119.942327,37.177017],
    '湖州':[120.1,30.86],
    '汕头':[116.69,23.39],
    '昆山':[120.95,31.39],
    '宁波':[121.56,29.86],
    '湛江':[110.359377,21.270708],
    '揭阳':[116.35,23.55],
    '荣成':[122.41,37.16],
    '连云港':[119.16,34.59],
    '葫芦岛':[120.836932,40.711052],
    '常熟':[120.74,31.64],
    '东莞':[113.75,23.04],
    '河源':[114.68,23.73],
    '淮安':[119.15,33.5],
    '泰州':[119.9,32.49],
    '南宁':[108.33,22.84],
    '营口':[122.18,40.65],
    '惠州':[114.4,23.09],
    '江阴':[120.26,31.91],
    '蓬莱':[120.75,37.8],
    '韶关':[113.62,24.84],
    '嘉峪关':[98.289152,39.77313],
    '广州':[113.23,23.16],
    '延安':[109.47,36.6],
    '太原':[112.53,37.87],
    '清远':[113.01,23.7],
    '中山':[113.38,22.52],
    '昆明':[102.73,25.04],
    '寿光':[118.73,36.86],
    '盘锦':[122.070714,41.119997],
    '长治':[113.08,36.18],
    '深圳':[114.07,22.62],
    '珠海':[113.52,22.3],
    '宿迁':[118.3,33.96],
    '咸阳':[108.72,34.36],
    '铜川':[109.11,35.09],
    '平度':[119.97,36.77],
    '佛山':[113.11,23.05],
    '海口':[110.35,20.02],
    '江门':[113.06,22.61],
    '章丘':[117.53,36.72],
    '肇庆':[112.44,23.05],
    '大连':[121.62,38.92],
    '临汾':[111.5,36.08],
    '吴江':[120.63,31.16],
    '石嘴山':[106.39,39.04],
    '沈阳':[123.38,41.8],
    '苏州':[120.62,31.32],
    '茂名':[110.88,21.68],
    '嘉兴':[120.76,30.77],
    '长春':[125.35,43.88],
    '胶州':[120.03336,36.264622],
    '银川':[106.27,38.47],
    '张家港':[120.555821,31.875428],
    '三门峡':[111.19,34.76],
    '锦州':[121.15,41.13],
    '南昌':[115.89,28.68],
    '柳州':[109.4,24.33],
    '三亚':[109.511909,18.252847],
    '自贡':[104.778442,29.33903],
    '吉林':[126.57,43.87],
    '阳江':[111.95,21.85],
    '泸州':[105.39,28.91],
    '西宁':[101.74,36.56],
    '宜宾':[104.56,29.77],
    '呼和浩特':[111.65,40.82],
    '成都':[104.06,30.67],
    '大同':[113.3,40.12],
    '镇江':[119.44,32.2],
    '桂林':[110.28,25.29],
    '张家界':[110.479191,29.117096],
    '宜兴':[119.82,31.36],
    '北海':[109.12,21.49],
    '西安':[108.95,34.27],
    '金坛':[119.56,31.74],
    '东营':[118.49,37.46],
    '牡丹江':[129.58,44.6],
    '遵义':[106.9,27.7],
    '绍兴':[120.58,30.01],
    '扬州':[119.42,32.39],
    '常州':[119.95,31.79],
    '潍坊':[119.1,36.62],
    '重庆':[106.54,29.59],
    '台州':[121.420757,28.656386],
    '南京':[118.78,32.04],
    '滨州':[118.03,37.36],
    '贵阳':[106.71,26.57],
    '无锡':[120.29,31.59],
    '本溪':[123.73,41.3],
    '克拉玛依':[84.77,45.59],
    '渭南':[109.5,34.52],
    '马鞍山':[118.48,31.56],
    '宝鸡':[107.15,34.38],
    '焦作':[113.21,35.24],
    '句容':[119.16,31.95],
    '北京':[116.46,39.92],
    '徐州':[117.2,34.26],
    '衡水':[115.72,37.72],
    '包头':[110,40.58],
    '绵阳':[104.73,31.48],
    '乌鲁木齐':[87.68,43.77],
    '枣庄':[117.57,34.86],
    '杭州':[120.19,30.26],
    '淄博':[118.05,36.78],
    '鞍山':[122.85,41.12],
    '溧阳':[119.48,31.43],
    '库尔勒':[86.06,41.68],
    '安阳':[114.35,36.1],
    '开封':[114.35,34.79],
    '济南':[117,36.65],
    '德阳':[104.37,31.13],
    '温州':[120.65,28.01],
    '九江':[115.97,29.71],
    '邯郸':[114.47,36.6],
    '临安':[119.72,30.23],
    '兰州':[103.73,36.03],
    '沧州':[116.83,38.33],
    '临沂':[118.35,35.05],
    '南充':[106.110698,30.837793],
    '天津':[117.2,39.13],
    '富阳':[119.95,30.07],
    '泰安':[117.13,36.18],
    '诸暨':[120.23,29.71],
    '郑州':[113.65,34.76],
    '哈尔滨':[126.63,45.75],
    '聊城':[115.97,36.45],
    '芜湖':[118.38,31.33],
    '唐山':[118.02,39.63],
    '平顶山':[113.29,33.75],
    '邢台':[114.48,37.05],
    '德州':[116.29,37.45],
    '济宁':[116.59,35.38],
    '荆州':[112.239741,30.335165],
    '宜昌':[111.3,30.7],
    '义乌':[120.06,29.32],
    '丽水':[119.92,28.45],
    '洛阳':[112.44,34.7],
    '秦皇岛':[119.57,39.95],
    '株洲':[113.16,27.83],
    '石家庄':[114.48,38.03],
    '莱芜':[117.67,36.19],
    '常德':[111.69,29.05],
    '保定':[115.48,38.85],
    '湘潭':[112.91,27.87],
    '金华':[119.64,29.12],
    '岳阳':[113.09,29.37],
    '长沙':[113,28.21],
    '衢州':[118.88,28.97],
    '廊坊':[116.7,39.53],
    '菏泽':[115.480656,35.23375],
    '合肥':[117.27,31.86],
    '武汉':[114.31,30.52],
    '大庆':[125.03,46.58]
};
var mapData=[
	{name:'广东',value:564155},
	{name:'四川',value:358594},
	{name:'上海',value:324766},
	{name:'北京',value:294848},
	{name:'福建',value:265161},
	{name:'山东',value:220714},
	{name:'浙江',value:136610},
	{name:'江苏',value:121998},
	{name:'天津',value:121130},
	{name:'湖北',value:79642},
	{name:'重庆',value:78114},
	{name:'云南',value:71919},
	{name:'湖南',value:68045},
	{name:'安徽',value:60144},
	{name:'河北',value:59478},
	{name:'广西',value:38753},
	{name:'陕西',value:38312},
	{name:'江西',value:30715},
	{name:'黑龙江',value:24952},
	{name:'河南',value:21091},
	{name:'辽宁',value:17061},
	{name:'吉林',value:12418},
	{name:'新疆',value:9583},
	{name:'甘肃',value:6508},
	{name:'海南',value:4929},
	{name:'山西',value:4898},
	{name:'贵州',value:4419},
	{name:'宁夏',value:1850},
	{name:'青海',value:1107},
	{name:'内蒙古',value:1055},
	{name:'西藏',value:290},
    {name: '台湾',value: 0 },
    {name: '香港',value: 0 },
    {name: '澳门',value: 0 },
    {name: '南海诸岛',value: 0 }
]
//西南五省
var mapData1=[
	  {name: '北京',value: 0},
	  {name: '天津',value: 0},
	  {name: '上海',value: 0},
	  {name: '重庆',value: 78114},
	  {name: '河北',value: 0},
	  {name: '河南',value: 0},
	  {name: '云南',value: 71919},
	  {name: '辽宁',value: 0},
	  {name: '黑龙江',value: 0},
	  {name: '湖南',value: 0},
	  {name: '安徽',value: 0},
	  {name: '山东',value: 0},
	  {name: '新疆',value: 0},
	  {name: '江苏',value: 0},
	  {name: '浙江',value: 0},
	  {name: '江西',value: 0},
	  {name: '湖北',value: 0},
	  {name: '广西',value: 0},
	  {name: '甘肃',value: 0},
	  {name: '山西',value: 0},
	  {name: '内蒙古',value: 0},
	  {name: '陕西',value: 0},
	  {name: '吉林',value: 0},
	  {name: '福建',value: 0},
	  {name: '贵州',value: 4419},
	  {name: '广东',value: 0},
	  {name: '青海',value: 0},
	  {name: '西藏',value: 290},
	  {name: '四川',value: 358594},
	  {name: '宁夏',value: 0},
	  {name: '海南',value: 0},
	  {name: '台湾',value: 0},
	  {name: '香港',value: 0},
	  {name: '澳门',value: 0},
	  {name: '南海诸岛',value: 0}
	]

//一路带一路
var mapData2=[
	  {name: '北京',value: 0},
	  {name: '天津',value: 0},
	  {name: '上海',value: 324766},
	  {name: '重庆',value: 78114},
	  {name: '河北',value: 0},
	  {name: '河南',value: 0},
	  {name: '云南',value: 71919},
	  {name: '辽宁',value: 17061},
	  {name: '黑龙江',value: 24952},
	  {name: '湖南',value: 0},
	  {name: '安徽',value: 0},
	  {name: '山东',value: 0},
	  {name: '新疆',value: 9583},
	  {name: '江苏',value: 0},
	  {name: '浙江',value: 136610},
	  {name: '江西',value: 0},
	  {name: '湖北',value: 0},
	  {name: '广西',value: 38753},
	  {name: '甘肃',value: 6508},
	  {name: '山西',value: 0},
	  {name: '内蒙古',value: 1055},
	  {name: '陕西',value: 38312},
	  {name: '吉林',value: 12418},
	  {name: '福建',value: 265161},
	  {name: '贵州',value: 0},
	  {name: '广东',value: 564155},
	  {name: '青海',value: 1107},
	  {name: '西藏',value: 290},
	  {name: '四川',value: 0},
	  {name: '宁夏',value: 0},
	  {name: '海南',value: 4929},
	  {name: '台湾',value: 0},
	  {name: '香港',value: 0},
	  {name: '澳门',value: 0},
	  {name: '南海诸岛',value: 0}
	]

//东南沿海
var mapData3=[
	  {name: '北京',value: 0},
	  //{name: '天津',value: 121130},
	  {name: '天津',value: 0},
	  {name: '上海',value: 324766},
	  {name: '重庆',value: 0},
	  //{name: '河北',value: 59478},
	  {name: '河北',value: 0},
	  {name: '河南',value: 0},
	  {name: '云南',value: 0},
	  //{name: '辽宁',value: 17061},
	  {name: '辽宁',value: 0},
	  {name: '黑龙江',value: 0},
	  {name: '湖南',value: 0},
	  {name: '安徽',value: 0},
	  {name: '山东',value: 220714},
	  {name: '新疆',value: 0},
	  {name: '江苏',value: 121998},
	  {name: '浙江',value: 136610},
	  {name: '江西',value: 0},
	  {name: '湖北',value: 0},
	  {name: '广西',value: 0},
	  {name: '甘肃',value: 0},
	  {name: '山西',value: 0},
	  {name: '内蒙古',value: 0},
	  {name: '陕西',value: 0},
	  {name: '吉林',value: 0},
	  {name: '福建',value: 265161},
	  {name: '贵州',value: 0},
	  {name: '广东',value: 564155},
	  {name: '青海',value: 0},
	  {name: '西藏',value: 0},
	  {name: '四川',value: 0},
	  {name: '宁夏',value: 0},
	  {name: '海南',value: 4929},
	  {name: '台湾',value: 0},
	  {name: '香港',value: 0},
	  {name: '澳门',value: 0},
	  {name: '南海诸岛',value: 0}
	]
var optionMap = {
	tooltip: {
		trigger: 'item',
		formatter:function(param){
			return '<div>'+param.name+'</div><div>网站数量：'+param.value+'</div>'
		}
	},
//	visualMap: {
//      min: 4000,
//      max: 200000,
//      itemHeight:'70',
//      left: '10%',
//      bottom: '10%',
//      inRange: {
//        //color: ['#3dcfff','#02639c']
//      	//color: ['#0ef0e6','#076ba6']
//	color: ['#3AE9F2','#FFBA3F'] 
//      },
//  //      text: ['高','低'],           // 文本，默认为数值文本
//      calculable: true,
//      textStyle:{
//          color:'#fff'
//      }
//  //  hoverLink: false
//	},
    geo: {
        map: 'china',
        zoom: 1.1,
        roam: false,
        top:'10%',
        label: {
            normal: {
                show: false,
                textStyle: {
                    color: '#fff'
                }
            },
            emphasis: {
                show: false,
                textStyle: {
                    color: '#fff'
                }
            },
        },
        itemStyle: {
            normal: {
                areaColor: 'rgba(88,154,225,0.1)',
                borderColor: '#589ae1',
                borderWidth: 1,
//              opacity:0.1
            },
            emphasis: {
                areaColor: 'rgb(6,214,224)'
            }
        },
    },
	series: [{
		zoom: 1.1,
		type: 'map',
		mapType: 'china',
        geoIndex:0,
		roam: false,
		label: {
			normal: {
				show: false,
				textStyle: {
					color: '#fff'
				}
			},
			emphasis: {
				show: false,
				textStyle: {
					color: '#fff'
				}
			}
		},
		data:mapData3
	}]
};

var mapChart = echarts.init(document.getElementById('ecMap'))
mapChart.setOption(optionMap);



function getOptionMap(datas){
	var optionMap = {
			tooltip: {
				trigger: 'item',
				formatter:function(param){
					return '<div>'+param.name+'</div><div>网站数量：'+param.value+'</div>'
				}
			},
			/*visualMap: {
		        min: 4000,
		        max: 200000,
		        itemHeight:'70',
		        left: '10%',
		        bottom: '10%',
		        inRange: {
		          //color: ['#3dcfff','#02639c']
		        	//color: ['#0ef0e6','#076ba6']
		           color: ['#3AE9F2','#FFBA3F']
			
		        },
		    //      text: ['高','低'],           // 文本，默认为数值文本
		        calculable: true,
		        textStyle:{
		            color:'#fff'
		        }
		    //  hoverLink: false
			},*/
		    geo: {
		        map: 'china',
		        zoom: 1.1,
		        roam: false,
		        top:'10%',
		        label: {
		            normal: {
		                show: false,
		                textStyle: {
		                    color: '#fff'
		                }
		            },
		            emphasis: {
		                show: false,
		                textStyle: {
		                    color: '#fff'
		                }
		            },
		        },
		        itemStyle: {
		            normal: {
	               	areaColor: 'rgba(88,154,225,0.1)',
	                borderColor: '#589ae1',
	                borderWidth: 1,
		            },
		            emphasis: {
		                areaColor: 'rgb(6,214,224)'
		            }
		        },
		    },
			series: [{
				//zoom: 1.1,
				type: 'map',
				mapType: 'china',
		        geoIndex:0,
				roam: true,
				label: {
					normal: {
						show: false,
						textStyle: {
							color: '#fff'
						}
					},
					emphasis: {
						show: false,
						textStyle: {
							color: '#fff'
						}
					}
				},
				data:datas
			}]
		};
	return optionMap;
}

//默认选择
//var arr=['山东','河北','辽宁','江苏','天津','浙江','福建','上海','广东','海南']
var arr=['山东','江苏','浙江','福建','上海','广东','海南']
cityEvt(arr)

function cityEvt(arr){
    var json=[]
    for(var i=0;i<arr.length;i++){
        json.push({
        		label: {
        			show: true,
//      			color:'rgba(255,255,255,0.8)'
        		},
            name: arr[i],
            itemStyle: {
                normal: {
                    borderColor: '#f4e925',
                    areaColor: 'rgba(88,154,225,0.7)'
                }
            }
        })
    }
    optionMap.geo.regions = json
    mapChart.setOption(optionMap);
}

//下拉框选择
var arrSelect=[]
$(".cityChange").change(function(){
    var n = $(this).val();
    var optionMap = null;
    var optionLine = null;
    var pieOpt = null;
    var dataX = ['2017-12','2018-01','2018-02'];
    var dataPie = null;
    if(n == 0){
    	arrSelect=["新疆","重庆","陕西","甘肃","宁夏","青海","内蒙古","黑龙江","吉林","辽宁","广西","云南","西藏","上海","福建","广东","浙江","海南"]
        cityEvt(arrSelect)
        optionMap = getOptionMap(mapData2);
    	var dataY = [2837.43,2272.85,2922];
    	optionLine = getOptionLine('一路带一路',dataX,dataY);
    	$("#comItem_h2").empty();
    	$("#comItem_h2").append("一带一路网站访问量排行");
    	/*$("#middle_pie_h2").empty();
    	$("#middle_pie_h2").append("一带一路");*/
    	$("#bottom_bar_h2").empty();
    	$("#bottom_bar_h2").append("一带一路网站接入数量占比");
    	$("#imp_middle_h2").empty();
    	$("#imp_middle_h2").append("一带一路网站分布");
    	$("#bottom_list_h2").empty();
    	$("#bottom_list_h2").append("一带一路网站近三个月访问量趋势");
    	//重点地区网站访问量排行
    	var datas = [
    		['vip.com','201450.09'],
    		['pps.tv','152716.23'],
    		['taobao.com','150675.46'],
    		['3322.org','126500.88'],
    		['cntv.cn','91407.76'],
    		['baofeng.com','88624.05'],
    		['people.com.cn','44450.43'],
    		['xinhuanet.com','42772.40'],
    		['gov.cn','39099.94'],
    		['alipay.com','33661.56'],
    		['cztv.com','28712.46'],
    		['wasu.cn','25035.73'],
    		['iqiyi.com','23181.60'],
    		['iqilu.com','21755.13'],
    		['gmw.cn','20540.45'],
    		['hexun.com','19458.09'],
    		['39.net','19404.78'],
    		['che168.com','19282.83'],
    		['cctv.com','15894.43'],
    		['news.cn','15793.75'],
    		['umeng.com','13256.03'],
    		['cs.com.cn','10278.76'],
    		['360doc.cn','9887.95'],
    		['meituan.com','9407.21'],
    		['court.gov.cn','9258.16'],
    		['yicai.com','8757.29'],
    		['zybang.com','8655.40'],
    		['huanqiu.com','8423.59'],
    		['cnzz.com','7815.45'],
    		['tvmao.com','7457.82']
    	];
    	ranklistLeftData(datas,'一带一路');
    	//重点地区网站分类占比
    	var data1=[
    		{name:'工商',value:86562},
    		{name:'金融',value:7179},
    		{name:'不良信息',value:9643}
    	]
    	pieOpt = getPieOpt(data1);
    	//机房接入网站数量TOP10
    	var data2 = [
    		['阿里云计算有限公司','2387953'],
    		['中国移动通信集团广东有限公司','278255'],
    		['腾讯云计算（北京）有限责任公司','220026'],
    		['中国电信股份有限公司云南分公司','218310'],
    		['网宿科技股份有限公司','170216'],
    		['中国电信股份有限公司上海分公司','120625'],
    		['中国电信股份有限公司福建分公司','118353'],
    		['中国联合网络通信有限公司重庆市分公司','113809'],
    		['中国联合网络通信有限公司广东省分公司','108705'],
    		['中国联合网络通信有限公司福建省分公司','96289']
    	];
    	ranklistRight1Data(data2);
    	
    	//网站接入数量排行
    	var optionBar = getOptionBar(dataPie1);
    	barChart.setOption(optionBar);
    	
    	var data3 = [
    		['2018-02','东方财富网：中国财经','eastmoney.com',187347781],  
    		['2018-02','王牌手机联盟_国内领','2345.cn',126188046],   
    		['2018-02','首页 - 广发银行','cgbchina.com.cn',39718359],   
    		['2018-02','中证网－中国权威的证券财经资讯网站','cs.com.cn',35728826],   
    		['2018-02','多享金汇-首页','duoxiang.com',26150214],   
    		['2018-02','东方财富网：中国财经','dfcfw.com',24298943],   
    		['2018-02','中国民生银行','cmbc.com.cn',21682088],   
    		['2018-02','全国中小企业股份转让系统','neeq.com.cn',16577003],   
    		['2018-02','南方财富网:今日股票','southmoney.com',14479565],   
    		['2018-02','中信银行金融门户','citicbank.com',12787086]
    	];
    	ranklistRight2Data(data3);
    	
    	$("#top_tip").empty();
    	$("#top_tip").append("截至2018年2月，全国信安系统监测发现“一带一路”地区接入<strong>159.57</strong>万个网站");
    
    	dataPie=[
    		{name:'教育类',value:36037 }, 
    		{name:'新闻类',value:13346 },
    		{name:'金融类',value:155020},
    		{name:'政府类',value:16238 },
    		{name:'卫生类',value:22503 }
    	]
    	pieChart.setOption(getPieOpt(dataPie));
    }else if(n == 1){
        arrSelect=['四川','云南','贵州','重庆','西藏']
        cityEvt(arrSelect)
    	var dataY = [333.24,212.88,479.09];
    	optionLine = getOptionLine('西南五省',dataX,dataY);
    	$("#comItem_h2").empty();
    	$("#comItem_h2").append("西南五省网站访问量排行");
    	/*$("#middle_pie_h2").empty();
    	$("#middle_pie_h2").append("西南五省");*/
    	$("#bottom_bar_h2").empty();
    	$("#bottom_bar_h2").append("西南五省网站接入数量占比");
    	$("#imp_middle_h2").empty();
    	$("#imp_middle_h2").append("西南五省网站分布");
    	$("#bottom_list_h2").empty();
    	$("#bottom_list_h2").append("西南五省网站近三个月访问量趋势");
    	optionMap = getOptionMap(mapData1);
    	var datas = [
    		['vip.com','38629.89'],
    		['baofeng.com','13227.47'],
    		['taobao.com','11290.92'],
    		['cztv.com','9570.82'],
    		['pps.tv','9355.13'],
    		['cntv.cn','8163.46'],
    		['iqilu.com','7101.88'],
    		['che168.com','7095.16'],
    		['people.com.cn','7078.75'],
    		['xinhuanet.com','6815.92'],
    		['wasu.cn','5384.02'],
    		['biddingx.com','4099.93'],
    		['cctv.com','4061.13'],
    		['court.gov.cn','3471.81'],
    		['hexun.com','3410.18'],
    		['cs.com.cn','3277.28'],
    		['alipay.com','3254.07'],
    		['umeng.com','3052.90'],
    		['iqiyi.com','3007.23'],
    		['gmw.cn','2235.86'],
    		['yicai.com','2217.75'],
    		['chinaso.com','2143.77'],
    		['hebtv.com','2091.41'],
    		['cnzz.com','2056.69'],
    		['gov.cn','1950.40'],
    		['huanqiu.com','1819.91'],
    		['39.net','1812.90']
    	];
    	ranklistLeftData(datas,'西南五省');
    	var data1 = [
    		{name:'工商',value:27329},
    		{name:'金融',value:9579},
    		{name:'不良信息',value:7032},
    		{name:'文化',value:3721},
    		{name:'教育',value:1863},
    		{name:'卫生',value:1160},
    		{name:'电子商务',value:658}
    	];
    	pieOpt = getPieOpt(data1);
    	var data2 = [
    		['中国电信股份有限公司四川分公司','272205'],
    		['阿里云计算有限公司','238230'],
    		['成都西维数码科技有限公司','221460'],
    		['腾讯云计算（北京）有限责任公司','220025'],
    		['中国电信股份有限公司云南分公司','217452'],
    		['网宿科技股份有限公司','169768'],
    		['中国联合网络通信有限公司重庆市分公司','113809'],
    		['中国电信股份有限公司云南分公司','86354'],
    		['北京蓝汛通信技术有限责任公司','35473'],
    		['上海帝联信息科技股份有限公司','30968']
    	];
		ranklistRight1Data(data2);
		
		//网站接入数量排行
    	$("#top_tip").empty();
    	$("#top_tip").append("截至2018年2月，全国信安系统监测发现“西南五省”地区接入<strong>51.33</strong>万个网站");
    	var optionBar = getOptionBar(dataPie2);
    	barChart.setOption(optionBar);
    	
    	var data3 = [
    		['2018-02','遵义医药高等专科学校','zunyiyizhuan.cn',7749932],   
    		['2018-02','医学教育网：中国大型国家医学考试网站','med66.com',2952181],   
    		['2018-02','法律教育网：中国专业','chinalawedu.com',2397349],   
    		['2018-02','升学e网通、升学助考一网通','ewt360.com',1880868],   
    		['2018-02','重庆市工业学校、重庆','cqiss.com',1613465],   
    		['2018-02','建设工程教育网:中国','jianshe99.com',1474366],   
    		['2018-02','体教联盟 ','univsport.com',593491],   
    		['2018-02','育路教育网 - 始创','yuloo.com',534771],   
    		['2018-02','掌门1对1官方网站','zhangmen.com',518570],   
    		['2018-02','云南成人高考,云南医 ','66199.net',445805]
    	];
    	ranklistRight2Data(data3);
    	
    	dataPie=[
    		{name:'教育类',value:16771 }, 
    		{name:'新闻类',value:4920 },
    		{name:'金融类',value:61599},
    		{name:'政府类',value:5180 },
    		{name:'卫生类',value:11235 }
    	]
    	pieChart.setOption(getPieOpt(dataPie));
    }else if(n == 2){
        //arrSelect=['山东','河北','辽宁','江苏','天津','浙江','福建','上海','广东','海南']
    	arrSelect=['山东','江苏','浙江','福建','上海','广东','海南']
        cityEvt(arrSelect)
    	var dataY = [7393.83,5223.57,9979.63];
    	optionLine = getOptionLine('东南沿海',dataX,dataY);
    	$("#comItem_h2").empty();
    	$("#comItem_h2").append("东南沿海网站访问量排行");
    	/*$("#middle_pie_h2").empty();
    	$("#middle_pie_h2").append("东南沿海");*/
    	$("#bottom_bar_h2").empty();
    	$("#bottom_bar_h2").append("东南沿海网站接入数量占比");
    	$("#imp_middle_h2").empty();
    	$("#imp_middle_h2").append("东南沿海网站分布");
    	$("#bottom_list_h2").empty();
    	$("#bottom_list_h2").append("东南沿海网站近三个月访问量趋势");
        optionMap = getOptionMap(mapData3);
        var datas = [
        	['vip.com','273601.79'],
        	['pps.tv','205307.25'],
        	['taobao.com','199829.93'],
        	['baofeng.com','159523.30'],
        	['3322.org','144797.46'],
        	['cntv.cn','126936.06'],
        	['wasu.cn','78876.01'],
        	['cztv.com','58604.89'],
        	['baofeng.net','56715.20'],
        	['people.com.cn','49915.64'],
        	['cnzz.com','46481.40'],
        	['xinhuanet.com','46180.36'],
        	['iqiyi.com','45028.87'],
        	['alipay.com','44653.09'],
        	['gov.cn','41578.11'],
        	['umeng.com','30689.72'],
        	['iqilu.com','29396.39'],
        	['hexun.com','24071.87'],
        	['gmw.cn','23365.99'],
        	['che168.com','21972.12'],
        	['39.net','20915.54'],
        	['cctv.com','20889.16'],
        	['10jqka.com.cn','20128.98'],
        	['dfcfw.com','19077.43'],
        	['court.gov.cn','18747.78'],
        	['yicai.com','18083.23'],
        	['news.cn','17754.87'],
        	['meituan.com','17746.21'],
        	['360doc.cn','14610.56'],
        	['qtmojo.com','14321.86']
        ];
        var data1 = [
        	{name:'金融',value:37774},
        	{name:'工商',value:66691},
        	{name:'不良信息',value:6260}
        ];
        ranklistLeftData(datas,'东南沿海');
        pieOpt = getPieOpt(data1);
        
        var data2 = [
        	['阿里云计算有限公司','2391690'],
        	['中国移动通信集团广东有限公司','278255'],
        	['中国电信股份有限公司山东分公司','236907'],
        	['中国电信股份有限公司江苏分公司','224933'],
        	['腾讯云计算（北京）有限责任公司','220026'],
        	['网宿科技股份有限公司','170334'],
        	['中国联合网络通信有限公司天津市分公司','159685'],
        	['中国联合网络通信有限公司山东省分公司','146934'],
        	['中国电信股份有限公司上海分公司','120625'],
        	['中国电信股份有限公司江苏分公司','120528']
        ];
        ranklistRight1Data(data2);
        
        //网站接入数量排行
    	$("#top_tip").empty();
    	$("#top_tip").append("截至2018年2月，全国信安系统监测发现“东南沿海”地区接入<strong>183.6</strong>万个网站");
    	var optionBar = getOptionBar(dataPie3);
    	barChart.setOption(optionBar);
    	
    	var data3 = [
    		['2018-02','东方财 富网：中国财经','eastmoney.com',15028863789],    
    		['2018-02','王牌手机联盟_国内领','2345.cn',3367802168],   
    		['2018-02','第一财经_只为更好决策','yicai.com',3201007196],   
    		['2018-02','WE理财官网—人人友','we.com',1015434263],      
    		['2018-02','中国平安保险集团提供','pingan.com.cn',470342323],    
    		['2018-02','1234tv财经直播平台官网','1234tv.com',161929384],    
    		['2018-02','华讯财经-最权威的财','591hx.com',143538972],    
    		['2018-02','中国民生银行','cmbc.com.cn',138594127],    
    		['2018-02','中金在线首页：财经','cnfol.com',96348894],    
    		['2018-02','呱呱财经官方网站','ggcj.com',95768942]
    	];
    	ranklistRight2Data(data3);
    	
    	dataPie=[
    		{name:'教育类',value:43261 }, 
    		{name:'新闻类',value:12568 },
    		{name:'金融类',value:187929},
    		{name:'政府类',value:14913 },
    		{name:'卫生类',value:26144 }
    	]
    	pieChart.setOption(getPieOpt(dataPie));
    }
    mapChart.setOption(optionMap);
    LineChart.setOption(optionLine);
});

var datas = [
	['vip.com','273601.79'],
	['pps.tv','205307.25'],
	['taobao.com','199829.93'],
	['baofeng.com','159523.30'],
	['3322.org','144797.46'],
	['cntv.cn','126936.06'],
	['wasu.cn','78876.01'],
	['cztv.com','58604.89'],
	['baofeng.net','56715.20'],
	['people.com.cn','49915.64'],
	['cnzz.com','46481.40'],
	['xinhuanet.com','46180.36'],
	['iqiyi.com','45028.87'],
	['alipay.com','44653.09'],
	['gov.cn','41578.11'],
	['umeng.com','30689.72'],
	['iqilu.com','29396.39'],
	['hexun.com','24071.87'],
	['gmw.cn','23365.99'],
	['che168.com','21972.12'],
	['39.net','20915.54'],
	['cctv.com','20889.16'],
	['10jqka.com.cn','20128.98'],
	['dfcfw.com','19077.43'],
	['court.gov.cn','18747.78'],
	['yicai.com','18083.23'],
	['news.cn','17754.87'],
	['meituan.com','17746.21'],
	['360doc.cn','14610.56'],
	['qtmojo.com','14321.86']
];
ranklistLeftData(datas,'东南沿海');
function ranklistLeftData(datas,type){
	var ranklistLeft = $('#ranklistLeft');
	ranklistLeft.empty();
	var str = "<table border='' cellspacing='' cellpadding='' class='tab_content'>";
	for(var i = 0 ; i < datas.length ; i++){
		var style = 'up';
		if(type == '东南沿海'){
			if(i == 2 || i == 4){
				style = 'down';
			}
		}else if(type == '一带一路'){
			if(i == 1 || i == 2){
				style = 'down';
			}
		}else if(type == '西南五省'){
			if(i == 3 || i == 5){
				style = 'down';
			}
		}
		
		str +="<tr>"+
    	"<td style='width:100px'>"+(i+1)+"</td>"+
    	"<td style='width:100px' title='"+datas[i][0]+"'>"+datas[i][0]+"</td>"+
    	"<td style='width:100px' title='"+datas[i][1]+"'>"+datas[i][1]+"</td>"+
    	"<td style='width:100px'><div class='"+style+"'></div></td>"+
    	"</tr>"
	}
	str +="</table>";
	ranklistLeft.append(str);
}
var data2 = [
	['阿里云计算有限公司','2391690'],
	['中国移动通信集团广东有限公司','278255'],
	['中国电信股份有限公司山东分公司','236907'],
	['中国电信股份有限公司江苏分公司','224933'],
	['腾讯云计算（北京）有限责任公司','220026'],
	['网宿科技股份有限公司','170334'],
	['中国联合网络通信有限公司天津市分公司','159685'],
	['中国联合网络通信有限公司山东省分公司','146934'],
	['中国电信股份有限公司上海分公司','120625'],
	['中国电信股份有限公司江苏分公司','120528']
];
ranklistRight1Data(data2);
function ranklistRight1Data(datas){
	var ranklistRight1 = $('#ranklistRight1');
	ranklistRight1.empty();
	var str = "<table border='' cellspacing='' cellpadding='' class='tab_content tab_content_right'>";
	for(var i = 0 ; i < datas.length ; i++){
		str +="<tr>"+
    	"<td>"+(i+1)+"</td>"+
    	"<td title='"+datas[i][0]+"'>"+datas[i][0]+"</td>"+
    	"<td title='"+datas[i][1]+"'>"+datas[i][1]+"</td>"+
//  	"<td title='"+datas[i][2]+"'>"+datas[i][2]+"</td>"+
    	"</tr>"
	}
	str +="</table>";
	ranklistRight1.append(str);
}

var data3 = [
	['2018-02','东方财富网：中国财经','eastmoney.com',187347781],  
	['2018-02','王牌手机联盟_国内领','2345.cn',126188046],   
	['2018-02','首页 - 广发银行','cgbchina.com.cn',39718359],   
	['2018-02','中证网－中国权威的证券财经资讯网站','cs.com.cn',35728826],   
	['2018-02','多享金汇-首页','duoxiang.com',26150214],   
	['2018-02','东方财富网：中国财经','dfcfw.com',24298943],   
	['2018-02','中国民生银行','cmbc.com.cn',21682088],   
	['2018-02','全国中小企业股份转让系统','neeq.com.cn',16577003],   
	['2018-02','南方财富网:今日股票','southmoney.com',14479565],   
	['2018-02','中信银行金融门户','citicbank.com',12787086]
];

ranklistRight2Data(data3);

function ranklistRight2Data(datas){
	var ranklistRight2 = $('#ranklistRight2');
	ranklistRight2.empty();
	var str = "<table border='' cellspacing='' cellpadding='' class='tab_content tab_content_right2'>";
	for(var i = 0 ; i < datas.length ; i++){
		str +="<tr>"+
    	"<td title='"+datas[i][0]+"' style='width:80px;'>"+datas[i][0]+"</td>"+
    	"<td title='"+datas[i][1]+"' style='width:50px;'>"+datas[i][1]+"</td>"+
    	"<td title='"+datas[i][2]+"' style='width:100px;'>"+datas[i][2]+"</td>"+
    	"<td title='"+datas[i][3]+"' style='width:60px;'>"+datas[i][3]+"</td>"+
    	"</tr>"
	}
	str +="</table>";
	ranklistRight2.append(str);
}

//折线图
optionLine = {
		color : ["#fce24f","#b8ff2e","#09e24b","#09e2cb","#09a7e2", "#0841b6", "#30059c", "#68059c","#9c058c","#9c0550"],
   	tooltip : {
      trigger: 'axis',
      axisPointer: {
          type: 'cross',
          label: {
              backgroundColor: '#6a7985'
          }
      }
    },
    grid: {
    	left: 50,
		top: 30,
		right: 25,
		bottom: 20
    },
    legend: {
    	show:true,
    	textStyle:{
    		color:'#fff'
    	}
//      data:['蒸发量','降水量','平均温度']
    },
    
    xAxis: [
        {
            type: 'category',
            data: ['2017-12','2018-01','2018-02'],
            boundaryGap:false,
            splitLine:{    //grid区域分隔线
                show:false
            },
            axisLabel: {  //坐标轴标签
                show: true,
                color: '#fff',
               // interval:false,
               // rotate:25,
              //  margin:10
            },
            axisTick: {
                show: true   //刻度线
            },
            axisLine:{
                show: true,   //坐标轴轴线
                lineStyle:{
                	color:'#fff'
                }
            },
            axisPointer: {
//              type: 'shadow'
            }
        }
    ],
    yAxis: [
        {
            type: 'value',
            name: '单位：亿',
            splitLine:{    //grid区域分隔线
                show:false
            },
            axisLabel: {  //坐标轴标签
                show: true,
//              formatter: '{value} °C',
                color: '#fff',
                margin:10
            },
            axisTick: {
                show: true   //刻度线
            },
            axisLine:{
                show: true,   //坐标轴轴线
                lineStyle:{
                	color:'#fff'
                }
            }
        }
    ],
    series: [
    	{
		symbol: 'emptyCircle',
		smooth:true,
        name:'一带一路',
        type:'line',
//      yAxisIndex: 1,
        data:[2837.43,2272.85,2922],
        itemStyle: { normal: {
            color:'#fce24f',
        }},
        lineStyle: { normal: {
            color:'#fce24f',
        }},
        areaStyle: {
            normal: {
                color:'#fce24f',
                opacity: 0.2
            }
        },
     }
        
    ]
};

var LineChart = echarts.init(document.getElementById('ecLine'))
LineChart.setOption(optionLine)

function getOptionLine(name,dataX,dataY){
	var optionLine = {
			color : ["#fce24f","#b8ff2e","#09e24b","#09e2cb","#09a7e2", "#0841b6", "#30059c", "#68059c","#9c058c","#9c0550"],
	   	tooltip : {
	      trigger: 'axis',
	      axisPointer: {
	          type: 'cross',
	          label: {
	              backgroundColor: '#6a7985'
	          }
	      }
	    },
	    grid: {
	    	left: 50,
			top: 30,
			right: 25,
			bottom: 20
	    },
	    legend: {
	    	show:true,
	    	textStyle:{
	    		color:'#fff'
	    	}
//	      data:['蒸发量','降水量','平均温度']
	    },
	    
	    xAxis: [
	        {
	            type: 'category',
	            data: dataX,//['2017-1','2017-2','2017-3','2017-4','2017-5','2017-6','2017-7','2017-8','2017-9','2017-10','2017-11','2017-12','2018-01','2018-02'],
	            boundaryGap:false,
	            splitLine:{    //grid区域分隔线
	                show:false
	            },
	            axisLabel: {  //坐标轴标签
	                show: true,
	                color: '#fff',
	               // interval:0,
	               // rotate:20,
	               // margin:10
	            },
	            axisTick: {
	                show: true   //刻度线
	            },
	            axisLine:{
	                show: true,   //坐标轴轴线
	                lineStyle:{
	                	color:'#fff'
	                }
	            },
	            axisPointer: {
//	              type: 'shadow'
	            }
	        }
	    ],
	    yAxis: [
	        {
	            type: 'value',
//	          name: '温度',
	            splitLine:{    //grid区域分隔线
	                show:false
	            },
	            axisLabel: {  //坐标轴标签
	                show: true,
//	              formatter: '{value} °C',
	                color: '#fff',
	                margin:10
	            },
	            axisTick: {
	                show: true   //刻度线
	            },
	            axisLine:{
	                show: true,   //坐标轴轴线
	                lineStyle:{
	                	color:'#fff'
	                }
	            }
	        }
	    ],
	    series: [
	    	{
			symbol: 'emptyCircle',
			smooth:true,
	        name:name,
	        type:'line',
	        //yAxisIndex: 1,
	        data:dataY//[0,0,0,0,0,0,0,0,0,0,0,0,21288060134,47909251958]
	     }
	        
	    ]
	};
	return optionLine;
}

window.addEventListener('resize',function(){
	pieChart.resize();
	mapChart.resize();
//	barChart.resize();
})